extends NodeState

@export var igorBoss: IgorBoss


var recover_time: float


func _on_process(delta : float) -> void:
	process_recover(delta)
	process_animation()


func _on_enter() -> void:
	recover_time = igorBoss.duration_recover
	igorBoss.damageReceiver.set_deferred("monitorable", true)


func _on_exit() -> void:
	pass


func process_recover(delta : float):
	if recover_time < 0.0:
		transition_state(IgorBoss.STATE_IDLE)
		return
	recover_time -= delta


func process_animation():
	igorBoss.animationPlayer.play(IgorBoss.ANIMATION_RECOVER)
